package com.jalarbee.web.jsf.controller;

import java.util.ArrayList;
import java.util.List;

import com.jalarbee.core.bootik.client.business.Client;
import com.jalarbee.core.bootik.client.service.ClientService;
import java.util.LinkedHashSet;
import java.util.Set;

public class ClientsController {

    private ClientService clientService;
    private List<Client> list = new ArrayList<Client>();
    private Set<Integer> keys = new LinkedHashSet<Integer>();

    public ClientsController() {
    }

    public List<Client> getClients() {
        list = clientService.findAll(null);
        return list;
    }

    public List<Client> getList() {
        return list;
    }

    public void setClientService(ClientService clientService) {
        this.clientService = clientService;
    }

    public Set<Integer> getKeys() {
        for (int i = 0; i < list.size(); i++) {
            keys.add(i);
        }
        return keys;
    }
}
